<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Standard Notes</title>
    <link
      rel="stylesheet"
      media="all"
      href="standard-notes-web/stylesheets/app.css"
    />
    <link rel="stylesheet" media="all" href="stylesheets/renderer.css" />
  </head>
  <body class="main-ui">
    <div class="sk-modal">
      <div class="challenge-modal sk-modal-content" style="margin: 2rem">
        <div class="sn-component">
          <div class="sk-panel">
            <div class="sk-panel-header">
              <div class="sk-panel-header-title capitalize">
                Password service access
              </div>
            </div>
            <div class="sk-panel-content" style="padding-bottom: 2rem">
              <h1 class="sk-h1">
                Choose how you want Standard Notes to store your account keys
              </h1>
              <p class="sk-p">
                Standard Notes can either use your operating system's password
                mananger or its own local storage facility.
              </p>
              <p class="sk-p">
                <strong
                  >Standard Notes currently does not have access to your system
                  password service.</strong
                >
                If you grant it access, you must quit the app for the change to
                come into effect.
              </p>
              <div class="sk-panel-row">
                <div class="sk-button-group">
                  <button class="sk-button info" onclick="quit()">
                    <div class="sk-label capitalize">
                      Use password service (quit)
                    </div>
                  </button>
                  <button
                    class="sk-button neutral capitalize"
                    onclick="useLocalStorage()"
                  >
                    <div class="sk-label">Use local storage (continue)</div>
                  </button>
                </div>
              </div>
              <div class="sk-panel-row"></div>
              <a class="sk-a capitalize" id="learn-more">Learn more</a>
              <div style="display: none" id="more-info">
                <div class="sk-panel-section">
                  <h1 class="sk-h1">What's the difference?</h1>
                  <p class="sk-p">
                    Using local storage, your account keys may be more easily
                    accessible by third-party programs, unlike in your password
                    manager which has additional protections built-in.
                  </p>
                  <p class="sk-p">
                    In either cases, the strongest way to protect your account
                    keys is to use a strong passcode, which will be used to
                    encrypt your keys and prevent any software or operating
                    system from reading them.
                    <strong>
                      If you plan on setting a passcode, you can safely use
                      local storage.
                    </strong>
                  </p>
                  <div class="sk-panel-row"></div>
                  <h2 class="sk-h2">
                    Granting Standard Notes access to your system password
                    service
                  </h2>
                  <p class="sk-p">
                    Note that
                    <strong>
                      granting access to your system password service will allow
                      Standard Notes to read, write, and delete <em>any</em> of
                      your saved passwords.
                    </strong>
                    Standard Notes will never use this privilege to do anything
                    more than reading and writing to its own entry.
                  </p>
                  <ol>
                    <li class="sk-li">Quit Standard Notes</li>
                    <li class="sk-li">
                      Open your software store (Ubuntu Software Center/Snap
                      Store)
                    </li>
                    <li class="sk-li">
                      In your installed apps list, click on Standard Notes
                    </li>
                    <li class="sk-li">
                      Look for a <em>Permissions</em> button
                    </li>
                    <li class="sk-li">
                      Make sure the permission associated with reading and
                      writing passwords is checked
                    </li>
                    <li class="sk-li">Open Standard Notes again</li>
                  </ol>
                  <h2 class="sk-h2">
                    Granting Standard Notes access to your system password
                    service from the command line
                  </h2>
                  <p class="sk-p">
                    Run the following command:<br />
                    <code
                      >snap connect
                      standard-notes:password-manager-service</code
                    >
                  </p>
                </div>
                <p>
                  <em>
                    Note: Password Service may also be referred to as keyring,
                    saved passwords, stored passwords, password manager,
                    passwords, or secrets, depending on your Linux
                    configuration.
                  </em>
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <script src="javascripts/renderer/grantLinuxPasswordsAccess.js"></script>
  </body>
</html>
